home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
ddj9304.zip
/
WAVELET.ZIP
/
DRAWIMAG.L_C
< prev
next >
Wrap
Text File
|
1992-02-07
|
7KB
|
119 lines
Creation date: Fri Feb 07 09:00:07 1992 drawimag.s page 1
Address Instruction Line # Source line
1 #include "dsp_type.h"
1 #define DSP32C 1
4 #endif
5
6 .global DRAWIMAG
7 /* DRAWIMAG
8 draw image of supplied point and connect to previous point
9 registers used: r1 r2 r3 r4 r5 r6 r7 r12 r13 r14
10 accumulators used: a0 a1
11
12 input: r12 - pointer to data pointer array
13 r13 - pointer to stack
14 r14 - return stack register, i.e. "TOP OF STACK"
15 a0 - data point to draw
16 */
0000 2099ff87 17 DRAWIMAG: a0 = *r12++ - a0 * *r12++; /* multiply by scalling coefficient */
0004 35380007 18 a1 = -a0 + *r12; /* determine if value above upper threshold */
0008 7a803387 19 a0 = ifalt(*r12++); /* if true, limit data to threshold */
000c 34b80007 20 a1 = a0 - *r12; /* determine if value below lower threshold */
0010 7a803387 21 a0 = ifalt(*r12++); /* if true, limit data to threshold */
0014 79800067 22 *r12++ = a0 = int(a0); /* convert data to integer format */
0018 00000000 23 nop;
001c 94ccfffe 24 r6e = r12 - 2; /* point to temporary storage */
0020 1ea10197 25 r1 = *r12++; /* load the row increment value */
0024 1ea40197 26 r4 = *r12++; /* load the row baseline offset value */
0028 1ea20197 27 r2 = *r12++; /* load the bit pointer */
002c 1ee30190 28 r3e = *r12; /* load the byte column pointer */
0030 1ea600d0 29 r6 = *r6; /* read the new byte column pointer offset */
0034 1ae20080 30 r2 - 0x80; /* check if first bit of new byte column */
0038 008000b0 31 if (ne) goto ADD_BAR; /* if true, add new bar to byte column */
003c 00000000 32 nop;
33 #if DSP32C
0040 1ae60017 34 r6 - 23; /* check if datum point is above baseline */
0044 01a0005c 35 if (le) goto ABOVE_BL; /* if true, it is above the baseline */
0048 00000000 36 nop;
004c 14800019 37 r4 = 25; /* top counter for clearing of pixel over bar */
0050 14a6ffe8 38 r5 = r6 - 24; /* middle counter for draw of bar pixels */
0054 a000006c 39 goto DRAW_COL; /* go draw the column of pixels */
0058 1a460030 40 r6 = 48 - r6; /* bottom counter for clearing of pixel under bar */
41
005c 18040a06 42 ABOVE_BL: r4 = r6; /* top counter for clearing of pixel over bar */
0060 18050a06 43 r5 = r6;
0064 1a450018 44 r5 = 24 - r5; /* middle counter for draw of bar pixels */
0068 14c00019 45 r6 = 25; /* bottom counter for clearing of pixel under bar */
006c 188402e0 46 DRAW_COL: r4 = r4 - 1; /* check if no top pixels are to be cleared */
0070 01600080 47 if (lt) goto NO_TOP; /* if true, skip clearing bytes above bar */
0074 188700e0 48 r7 = r7 - r7; /* force the register to zero */
0078 8c200004 49 do 0, r4; /* repeat next instruntion r4+1 times */
007c 1f670061 50 *r3++r1 = r7l; /* zero the bytes above the bar */
0080 188502e0 51 NO_TOP: r5 = r5 - 1; /* check if no bar pixels are to be set */
0084 01600094 52 if (lt) goto NO_MID; /* if true, skip setting bytes of bar */
0088 00000000 53 nop;
008c 8c200005 54 do 0, r5; /* repeat next instruntion r5+1 times */
0090 1f620061 55 *r3++r1 = r2l; /* MSB of byte is bar, others cleared */
0094 188602e0 56 NO_MID: r6 = r6 - 1; /* check if no bottom pixels are to be cleared */
0098 016000a8 57 if (lt) goto NO_BOT; /* if true, skip clearing bytes below bar */
009c 00000000 58 nop;
00a0 8c200006 59 do 0, r6; /* repeat next instruntion r6+1 times */
00a4 1f670061 60 *r3++r1 = r7l; /* zero the bytes below the bar */
00a8 a00000e0 61 NO_BOT: goto SHIFTBIT; /* go shift the bit pointer and clear up */
Creation date: Fri Feb 07 09:00:08 199 drawimag.s page 2
Address Instruction Line # Source line
00ac 1ee30190 62 r3e = *r12; /* reload the byte pointer */
63
00b0 1ae60018 64 ADD_BAR: r6 - 24; /* check if datum below baseline */
00b4 018000c4 65 if (gt) goto BELOW_BL; /* if true, datum is below baseline */
00b8 1a860018 66 r6 = r6 - 24; /* calculate length of bar */
00bc 18a600c0 67 r6 = -r6; /* datum above baseline length was negative */
00c0 98a10020 68 r1e = -r1; /* datum above baseline, increment is decrement */
00c4 98040060 69 BELOW_BL: r4e = r4 + r3; /* add baseline offset to byte column pointer */
00c8 98050824 70 r5e = r4 + r1; /* move pointer away from the baseline */
00cc 14e00000 71 r7 = 0; /* zero initial storage value */
00d0 8c220006 72 do 2, r6; /* repeat the next 3 instructions r6+1 times */
00d4 1e6600a1 73 r6l = *r5++r1; /* load the byte */
00d8 1f670081 74 *r4++r1 = r7l; /* store the byte and move the pointer */
00dc 19470846 75 r7 = r6 | r2; /* OR byte with bit pointer to set the bit */
122 #endif
123
00e0 19820040 124 SHIFTBIT: r2 = r2 >> 1; /* shift the pixel pointed to right */
00e4 008000f4 125 if (ne) goto NO_WRAP; /* if true, don't wrap the pixel pointer */
00e8 9a8c0002 126 r12e = r12 - 2; /* point to bit pointer storage */
00ec 14400080 127 r2 = 0x0080; /* new bit mask if pixel wraps */
00f0 980302e0 128 r3e = r3 + 1; /* increment base to next byte upon wrap */
00f4 1fa20197 129 NO_WRAP: *r12++ = r2; /* save the next bit pointer */
00f8 002e0000 130 return (r14);
00fc 1fe30197 131 *r12++ = r3e; /* save the next byte pointer start value */
132 /* END OF DRAWIMAG */
133
198 #endif
d3as:warning:drawimag.s line 62: branch dest can't start with inst referencing
reg being loaded
Symbol Table
.file drawimag.s
.bank0 (section 1) size 0x100
NO_BOT section 1 defined value 0xa8
SHIFTBIT section 1 defined value 0xe0
BELOW_BL section 1 defined value 0xc4
NO_MID section 1 defined value 0x94
DRAWIMAG section 1 global defined value 0x0
ADD_BAR section 1 defined value 0xb0
NO_TOP section 1 defined value 0x80
NO_WRAP section 1 defined value 0xf4
ABOVE_BL section 1 defined value 0x5c
DRAW_COL section 1 defined value 0x6c